<?php

use app\adminapi\middleware\JwtAuth;
use app\adminapi\middleware\OperateLog;
use app\adminapi\middleware\CheckPermission;
use think\facade\Route;


// 用户路由
Route::group('user', function () {
    Route::get('index', 'user.User/index')->name('user:list')->setOption('real_name', '获取用户列表');
    Route::get('read/:id', 'user.User/read')->name('user:detail')->setOption('real_name', '用户详情');
    Route::post('save', 'user.User/save')->name('user:add')->setOption('real_name', '添加用户');
    Route::put('update/:id', 'user.User/update')->name('user:update')->setOption('real_name', '编辑用户');
    Route::delete('delete/:id', 'user.User/delete')->name('user:delete')->setOption('real_name', '删除用户');
})->middleware([JwtAuth::class, OperateLog::class, CheckPermission::class]);

// 用户标签
Route::group('user_tag', function () {
    Route::get('index', 'user.UserTag/index')->name('user_tag:list')->setOption('real_name', '获取用户标签列表');
    Route::get('read/:id', 'user.UserTag/read')->name('user_tag:detail')->setOption('real_name', '获取用户标签详情');
    Route::post('save', 'user.UserTag/save')->name('user_tag:add')->setOption('real_name', '添加用户标签');
    Route::put('update/:id', 'user.UserTag/update')->name('user_tag:update')->setOption('real_name', '编辑用户标签');
    Route::delete('delete/:id', 'user.UserTag/delete')->name('user_tag:delete')->setOption('real_name', '删除用户标签');
})->middleware([JwtAuth::class, OperateLog::class, CheckPermission::class]);

// 用户标签分类
Route::group('user_tag_cate', function () {
    Route::get('index', 'user.UserTagCate/index')->name('user_tag_cate:list')->setOption('real_name', '获取用户标签分类列表');
    Route::get('read/:id', 'user.UserTagCate/read')->name('user_tag_cate:detail')->setOption('real_name', '获取用户标签分类详情');
    Route::post('save', 'user.UserTagCate/save')->name('user_tag_cate:add')->setOption('real_name', '添加用户标签分类');
    Route::put('update/:id', 'user.UserTagCate/update')->name('user_tag_cate:update')->setOption('real_name', '编辑用户标签分类');
    Route::delete('delete/:id', 'user.UserTagCate/delete')->name('user_tag_cate:delete')->setOption('real_name', '删除用户标签分类');
})->middleware([JwtAuth::class, OperateLog::class, CheckPermission::class]);

// 申请提现
Route::group('withdrawal_apply', function () {
    Route::get('index', 'user.WithdrawalApply/index')->name('withdrawal_apply:index');
    Route::get('read/:id', 'user.WithdrawalApply/read')->name('withdrawal_apply:read');
    Route::post('save', 'user.WithdrawalApply/save')->name('withdrawal_apply:save');
    Route::put('update/:id', 'user.WithdrawalApply/update')->name('withdrawal_apply:update');
    Route::delete('delete/:id', 'user.WithdrawalApply/delete')->name('withdrawal_apply:delete');
})->middleware([JwtAuth::class, OperateLog::class, CheckPermission::class]);
